<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.ycy.ss.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>临时上传 - 管理</title>
</head>
<body>
	list pwd:<br/>
	<input type="text" id="pwdAdd" /><input type="button" value="add" onclick="javascript:pwdAdd();" /><br/>
	<input type="button" value="clear" onclick="javascript:pwdClear();"/><br/>
	<%
	for(String pwd : (String[])request.getAttribute("pwdList")){
	%>
	<%=pwd%><br/>
	<%
	}
	%>
	
	<br/><br/>list file:<br/>
	<%
	for(String file : (String[])request.getAttribute("fileList")){
	%>
	<input type="button" value="download" onclick="javascript:downloadFile('<%=file%>');"/>&nbsp;<%=file%><br/>
	<%
	}
	%>
	
<script type="text/javascript">
var pwdAdd=function(){
	var pwd=document.getElementById('pwdAdd').value;
	if(!pwd){
		alert('please input pwd.');
		return;
	};
	window.location.href='<%=Constant.BASE_URL%>uploadManager?type=add&pwd='+pwd;
};

var pwdClear=function(){
	if(confirm('sure?')){
		window.location.href='<%=Constant.BASE_URL%>uploadManager?type=clear';
	};
};

var downloadFile=function(f){
	window.location.href='<%=Constant.BASE_URL%>uploadManager?type=download&file='+f;
}
</script>
</body>
</html>